package com.qingzhuge.dao.id;

import com.qingzhuge.id.SnowflakeId;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;

/**
 * @author : zero.xiao
 * @description : 生成id的方法
 * @date :2019/1/4 0004 下午 14:38
 * @since : 1.0.0
 * @modified :
 */
@Service
@Component
@Transactional(rollbackFor = Exception.class)
public class IdStringGenerate extends BaseIdGenerate {
    @Override
    protected Serializable getId(SnowflakeId snowflakeId) {
        return String.valueOf(snowflakeId.nextId());
    }
}